package com.camel.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.camel.base.mapper.ZsInformationMapper;
import com.camel.base.model.ZsInformation;
import com.camel.base.service.ZsInformationService;
import com.camel.core.service.AbstractBaseCommonService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author 86183
 * @description 针对表【zs_information(号码信息)】的数据库操作Service实现
 * @createDate 2023-02-24 10:39:00
 */
@Service
public class ZsInformationServiceImpl extends AbstractBaseCommonService<ZsInformationMapper, ZsInformation> implements ZsInformationService<ZsInformation> {
    @Override
    public ZsInformation selectInfo(Integer surveyId, String phone, String lable) {
        if (StringUtils.isEmpty(lable)) {
            return getOne(new QueryWrapper<ZsInformation>().eq("survey_id", surveyId)
                    .eq("phone", phone), false);
        } else {
            return getOne(new QueryWrapper<ZsInformation>().eq("survey_id", surveyId)
                    .eq("phone", phone).eq("lable", lable), false);
        }
    }
}




